package com.jcooky.tutorfs.proxy.filesystem;

public abstract class AbstractFileSystem {
	public abstract void open() throws FileSystemException;
	
	public abstract void mkdir(String path) throws FileSystemException;
	public abstract void rmdir(String path) throws FileSystemException;
	public abstract void write(String path, byte []data, int pos, int size) throws FileSystemException;
	public abstract byte []read(String path, int pos, int size) throws FileSystemException;
	
	public abstract void close() throws FileSystemException;
	
	public static AbstractFileSystem getFileSystem(String type) {
		if ("HDFS".equalsIgnoreCase(type)) {
			return new HDFSFileSystem();
		}
		return null;
	}
}
